import "reflect-metadata";
import {PipeTransform} from "@nestjs/common";

export function UsePipes(...pipes: PipeTransform[]) {
    return function (target:object | Function,propertyKey?:string,descriptor?:PropertyDescriptor) {
        // 如果这个有值说明装饰的函数，方法
        if(descriptor){
            Reflect.defineMetadata('pipes', pipes, descriptor.value);
        }else{
            Reflect.defineMetadata('pipes', pipes, target);
        }
    }
}
